import request from "@/api/http";
export interface params4createEnterpriseApi {
    enterpriseId?: string,
    enterpriseName: string,
    enterpriseIntro: string,
    enterpriseImgKey: string,
    enterpriseClass: string,
    enterpriseContactWay?: string,
}
export const createEnterpriseApi = ( param: params4createEnterpriseApi ) => {
    return request({
        url: '/enterprise/create',
        method: 'POST',
        data: {
            ...param,
        }
    })
}
export const editEnterpriseApi = ( param: params4createEnterpriseApi ) => {
    return request({
        url: '/enterprise/update_info',
        method: 'PUT',
        data: {
            ...param,
        }
    })
}
export const getEnterpriseInfoApi = (id: string) => {
    return request({
        url: `/enterprise/get_info?enterpriseId=${id}`,
        method: 'GET',
    })
}

export const quitEnterpriseApi = (enterpriseId: string) => {
    return request({
        url: `/enterprise/quit_enterprise`,
        method: 'POST',
        data: {
            enterpriseId,
        }
    })
}
export const deleteEnterpriseApi = (enterpriseId: string) => {
    return request({
        url: `/enterprise/delete`,
        method: 'POST',
        data: {
            enterpriseId,
        }
    })
}
export const getIfInEnterprise = (enterpriseId: string) => {
    return request({
        url: `/enterprise/has_verification?enterpriseId=${enterpriseId}`,
        method: 'GET',
    })
}

export interface params4transferEnterpriseApi {
    enterpriseId: string,
    targetUserId: string,
}
export const transferEnterpriseApi = (param: params4transferEnterpriseApi) => {
    return request({
        url: `enterprise/transform`,
        method: 'POST',
        data: param
    })
}
export const followEnterpriseApi = (id: string) => {
    return request({
        url: `/follow_sys/follow_enterprise/`,
        method: 'POST',
        data: {
            followee_enterprise_id: id
        }
    })
}
